package com.svndiffdoc;

public class AnnotatedFileLineCharacter {
    private final Character character;
    private boolean isMatchPoint;

    public AnnotatedFileLineCharacter(char c) {
        this.character = c;
    }

    public Character getCharacter() {
        return character;
    }

    public boolean isMatchPoint() {
        return isMatchPoint;
    }

    public void setMatchPoint(boolean isMatchPoint) {
        this.isMatchPoint = isMatchPoint;
    }

    @Override
    public int hashCode() {
        if (character != null) {
            return character.hashCode();
        }
        return 1;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj instanceof AnnotatedFileLineCharacter) {
            return character.equals(((AnnotatedFileLineCharacter)obj).getCharacter());
        }
        return false;
    }
}
